<template>
  <el-dialog
    title="驳回原因"
    @close="closeDialog"
    :visible.sync="rejectReasonDia"
    :close-on-click-modal="false"
    custom-class="dialog-minwidth"
    class="detailDialog"
    :modal-append-to-body="false"
    width="550px"
  >
    <el-row>
      <el-col :span="6">驳回操作人：</el-col>
      <el-col :span="18">{{ rejectInfo.rejectUserType || '--' }}</el-col>
    </el-row>
    <el-row>
      <el-col :span="6">驳回原因：</el-col>
      <el-col :span="18">{{ rejectInfo.rejectReason || '--' }}</el-col>
    </el-row>
  </el-dialog>
</template>
<script>
export default {
  name: 'dialogRejectReason',
  props: ['salaryId', 'projectId', 'updaterId'],
  data() {
    return {
      rejectReasonDia: true,
      rejectInfo: {},
    }
  },
  created() {
    this.getRejectInfo()
  },
  methods: {
    getRejectInfo() {
      this.axios({
        method: 'post',
        url: 'api-su/cs/salary/expand/getSalaryRejectInfo',
        data: {
          salaryId: this.salaryId,
          userId: this.updaterId,
        },
      })
        .then((response) => {
          if (!response.data.hasError) {
            this.rejectInfo = response.data.result
          }
        })
        .catch((error) => {
          this.$message.error('数据获取失败')
        })
    },
    closeDialog() {
      this.$emit('closeDia')
    },
  },
}
</script>
<style lang="less" scoped>
.detailDialog {
  .el-row {
    height: 35px;
    line-height: 35px;
    margin-bottom: 10px;
  }
  .el-col-6 {
    text-align: right;
  }
  .el-col-18 {
    text-align: left;
    padding-left: 15px;
  }
}
</style>
